#ifndef IterIter_First
#define IterIter_First
#ifdef __GNUG__
#pragma interface
#endif

#include "Container.h"
#include "Iterator.h"

//----- IterIter - iterator management -----------------------------------------

class IterIter {
	Iterator *head, *ci;
public:
	IterIter(Container *ctr) { head= &ctr->iterHead; ci= head; };
	Iterator *operator()() { return (ci= ci->next, ci == head) ? 0 : ci; }
};

//  IterIter should be a nested type within Container...

#define ForEachIterDo(type, call) \
{ \
	Iterator *it; \
	IterIter next(this); \
	while ( it= next() ) \
		((type *) it)->call; \
}
		
//      ForEachIter(OrdCollIter, OnAddAt(idx));     // e.g.

#endif
